﻿<section class="content">
    <div ng-controller="personSearchCtrl">
        <div>
            <div class="row ">
                <div class="col-md-5 form-horizontal">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="col-md-4 control-label">Idnp</label>
                            <div class="col-md-8">
                                <input class="form-control" type="text" ng-model="filter.idnp" on-enter="search()" />
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="col-md-4 control-label">Year of Birth</label>
                            <div class="col-md-8">
                                <input class="form-control" type="text" ng-model="filter.birthYear" on-enter="search()">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-5 form-horizontal">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="col-md-4 control-label">Last Name</label>
                            <div class="col-md-8">
                                <input class="form-control" type="text" ng-model="filter.lastName" on-enter="search()" />
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="col-md-4 control-label">First Name</label>
                            <div class="col-md-8">
                                <input class="form-control" type="text" ng-model="filter.firstName" on-enter="search()" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-2 btn-group-vertical pull-right">
                    <button type="button" ng-click="search()" class="btn btn-primary"><i class="fa fa-search"></i> Search </button>
                    <button type="button" ng-click="clear()" class="btn btn-default"><i class="fa fa-refresh"></i> Clear </button>
                </div>
            </div>

        </div>
        <div class="box-body no-padding">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>Idnp</th>
                        <th>Name</th>
                        <th>Date of Birth</th>
                        <th>Sex</th>
                        <th>Address</th>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="person in persons">
                        <td>{{person.idnp}}</td>
                        <td>{{person.fullName}}</td>
                        <td>{{person.dateBirth | date:'dd/MM/yyyy'}}
                        <td>
                        <td>{{person.sex}}</td>
                        <td>{{person.address}}</td>
                        <td style="width: 60px;">
                            <a class="btn bg-orange btn-social" href="#/referralsSchedule/{{person.id}}">
                                <i class="fa fa-users"></i><span>Schedule</span>
                            </a>
                        </td>
                        <td style="width: 60px;">
                            <a class="btn bg-olive btn-social" href="#/personCard/{{person.id}}">
                                <i class="fa fa-calendar"></i><span>Records</span>
                            </a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</section>